package lanqiaobei;

import java.util.Scanner;

public class qiujiecheng {
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		long k = scanner.nextLong();
		long count;
		long a = 5;
		while (true) {
			long tempA = a;
			count = 0;
			while (tempA > 0) {
				tempA /= 5;
				count += tempA;
			}
			if (count < k) {
				a += 5;
			} else if (count == k) {
				System.out.println(a);
				break;
			} else {
				System.out.println(-1);
				break;
			}
		}
		scanner.close();
	}

}
